package com.fhz.a2102shopjava.ui.home;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.fhz.a2102shopjava.base.BaseViewModel;
import com.fhz.a2102shopjava.callback.ApiResponse;
import com.fhz.a2102shopjava.entity.Banner;
import com.fhz.a2102shopjava.entity.GoodsInfo;
import com.fhz.a2102shopjava.entity.ResponseBean;

import java.util.List;

import javax.inject.Inject;

import dagger.hilt.android.lifecycle.HiltViewModel;
import io.reactivex.Observable;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import retrofit2.http.Query;

@HiltViewModel
public class HomeViewModel extends BaseViewModel<HomeRepository> {

    @Inject
    public HomeViewModel(HomeRepository repository) {
        super(repository);
    }

    public LiveData<ApiResponse<ResponseBean<List<Banner>>>> getBanner(int type, int page , int pageSize){
        return repository.getBanner(type, page, pageSize);
    }

    public LiveData<ApiResponse<ResponseBean<List<GoodsInfo>>>> getGoodsInfo(@Query("page") int page, @Query("pageSize") int pageSize){
        return repository.getGoodsInfo(page, pageSize);
    }

}